import asyncio
from tortoise import Tortoise
from tool.sessing import TORTOISE_ORM
from models.m import Chapter, FileStorage

async def show():
    await Tortoise.init(config=TORTOISE_ORM)
    
    print("检查章节内容存储情况：\n")
    
    # 检查chapters表
    chapter_count = await Chapter.all().count()
    print(f"1. chapters表 - 记录数: {chapter_count}")
    
    # 检查file_storage表
    file_count = await FileStorage.all().count()
    print(f"2. file_storage表 - 记录数: {file_count}")
    
    print("\n结论：")
    if file_count == 0:
        print("  当前3000字内容并没有真正存储在数据库中")
        print("  只是chapters表记录了word_count=3000（字数统计）")
        print("  实际的文本内容需要在file_storage表中存储")
    
    await Tortoise.close_connections()

asyncio.run(show())

